The present invention relates to a power supply device and a light emitting element drive device. Specifically, the power supply device and the light emitting element drive device perform pulse width modulation (PWM) control by using a microprocessor.
Japanese Patent Publication No. H09-331017 discloses a light emitting element drive device. In the disclosed light emitting element drive device, a pulse oscillator generates a driving signal with a predetermined duty ratio based on a digital signal corresponding to a calculated value that is a control command value calculated by a microprocessor as a digital circuit. When the digital signal is a 10 bit signal, a duty ratio of the driving signal is changed based on its digital values in a range of 0 through 1023.
The steps that adjust the duty ratio depend on the number of bits of the digital signal. When a duty ratio is finely adjusted, the number of bits of a digital signal increases. When the number of bits of a digital signal increases, the number of lines for the output signals from the microprocessor increases. However, the number of lines for output signals from a microprocessor can decrease when a driving signal is generated inside the microprocessor. Therefore, the frequency of an operation clock has to be high in order to finely adjust a duty ratio.
An object of the present invention is to provide a power supply device and a light emitting element drive device in which a driving signal with a finely adjusted duty ratio can be generated by an operation clock signal having a lower frequency than the conventional device. The above features can be achieved with a simple circuit configuration and without increasing the number of lines for the output signals from a digital circuit.